package com.it.dao;

import com.it.domain.Song;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SongMapper {

    int AddSong(Song song);

    int DeleteSong(Integer id);

    int UpdateSong(Song song);//修改

    @Select("select * from song where id = #{id}")
    Song SelectBySongId(Integer id);//歌曲id查询


    List<Song> SelectBySingerId(Integer singerId);//歌手id查询

    @Select("select * from song where name like #{name}")
    List<Song> SelectByName(String name);


    List<Song> SelectAll(@Param("PageNum") Integer PageNum, @Param("PageSize") Integer PageSize, @Param("singerId") Integer singerId,@Param("name") String name);//查询所有

    @Select("select count(id) from song")
    Integer SelectTotal();

    Integer SelectSingerSongTotal(Integer singerId);

    List<Song> GetAllSong();

    Song SelectBySong(@Param("name") String name,@Param("album") String album,@Param("singerId") Integer singerId );

    Integer UpdateType(Integer id,Integer isDelete);

    Integer getSongsTotal(Integer singerId);

    Integer getAlbumTotal(Integer singerId);

    List<Song> getSongInfo(Integer singerId);

}
